package com.example.moreeyes;

import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager2.adapter.FragmentStateAdapter;

import java.util.List;

public class ViewPager2Adapter extends FragmentStateAdapter {
    private List<Fragment> fragmentList = null;
    public ViewPager2Adapter(@NonNull FragmentActivity fragmentActivity,List<Fragment>fragments) {
        super(fragmentActivity);
        this.fragmentList = fragments;
    }
    @NonNull
    @Override
    public Fragment createFragment(int position) {
        return this.fragmentList.get(position);
    }

    @Override
    public int getItemCount() {
        return this.fragmentList.size();
    }
}
